System and method for recognition of a hand-drawn chart in ink input

ABSTRACT

A system and method for recognition of hand-drawn charts in ink input is provided. A chart recognizer may be provided that may recognize a hand-drawn diagram or chart in ink input. The chart recognizer may include a connectivity-based recognizer for recognizing a hand-drawn chart having connected areas such as a pie chart, a connected container recognizer for recognizing a hand-drawn chart having connected containers such as a cycle diagram, and a curve recognizer for recognizing a hand-drawn chart having a curve. The connected container recognizer may also recognize a hand-drawn chart having intersecting containers such as a Venn diagram or a hand-drawn chart having a container that may include another container such as a target diagram.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present invention claims priority to U.S. provisional patentapplication Ser. No. 60/612,200 filed Sep. 22, 2004, and incorporatedherein in its entirety.

The present invention is related to the following United States patentapplications, filed concurrently herewith and incorporated herein intheir entireties:

-   -   Docket no. 4892/313153 “System And Method For Connectivity-Based        Recognition of a Hand-Drawn Chart In Ink Input,”    -   Docket no. 4893/313154 “System And Method For Connected        Container Recognition of a Hand-Drawn Chart In Ink Input,” and    -   Docket no. 4894/313155 “System And Method For Curve Recognition        in a Hand-Drawn Chart In Ink Input.”

FIELD OF THE INVENTION

The invention relates generally to computer systems, and moreparticularly to an improved system and method for recognition of ahand-drawn chart in ink input.

BACKGROUND OF THE INVENTION

The ability to recognize various types of hand-drawn diagrams and chartsis important for users to be able to draw directly on their computersusing ink input or ink notes. Current hardware and software may be ableto capture ink representing handwriting reasonably well but is currentlyunable to similarly recognize and represent the meaning of hand-drawncharts in ink input. As a result, users instead use menu-basedapplication programs to create drawings of diagrams and charts. Variousdiagrams and charts may be presented by such application programs for auser to select and copy onto a drawing grid or into a document forediting. For example, a drawing application may include a menu optionfor inserting a diagram or organization chart in a document for editing.

Research focused on recognition of hand-drawn objects has yieldedmarginal results to date. For instance, incremental recognitionalgorithms have been used that may recognize simple geometric shapessuch as a circle or a box from a specific number of strokes made in aparticular order. However, such incremental algorithms rely on strokeorder and/or assume a particular number of strokes in order to recognizea particular hand-drawn object. Such an approach fails to be robust forseveral reasons. For one, none of the incremental algorithms solves thegrouping problem of deciding which collection of strokes belongstogether because those strokes represent a specific shape or hand-drawnobject such as a chart. Without the ability to group strokes togetherthat belong to a shape or hand-drawn object, incremental algorithms maynot accommodate multi-stroke shapes or hand-drawn objects such as adiagram or chart.

What is needed is a way for recognizing and representing the meaning ofhand-drawn objects that is insensitive to stroke input order and/or thenumber of strokes required to form any given diagram or chart. Any suchsystem and method should be able to detect multi-stroke hand-drawncharts and be able to decide which collection of strokes belong togetherthat represent different diagrams or charts.

SUMMARY OF THE INVENTION

Briefly, the present invention provides a system and method forrecognition of a hand-drawn chart in ink input. To this end, a chartrecognizer may be provided that may recognize a hand-drawn diagram orchart in ink input. The chart recognizer may include aconnectivity-based recognizer for recognizing a hand-drawn chart havingconnected areas such as a pie chart, a bar chart, a pyramid diagram, andso forth. The chart recognizer may also include a connected containerrecognizer for recognizing a hand-drawn chart having connectedcontainers such as a cycle diagram, a radial diagram, an organizationalchart and so forth. The connected container recognizer may alsorecognize a hand-drawn chart having intersecting containers such as aVenn diagram or a hand-drawn chart having a container that may includeanother container such as a target diagram. Additionally, the chartrecognizer may include a curve recognizer for recognizing a hand-drawnchart having a curve such as a line segment, a normal distributioncurve, an exponential curve, a logarithmic curve and so forth.

In one embodiment, container and connector detection may be performedfor ink input received. Then shape recognition may be performed for eachcontainer and each connector detected within the ink input. Next, chartrecognition may then be performed for containers and connectorsrecognized within the ink input. A drawing may then be generated foreach hand-drawn chart recognized within the ink input. To generate adrawing from a recognized hand-drawn chart, content detection and shaperefinement may be performed.

In general, any type of hand-drawn diagram or chart may be recognized byperforming chart recognition. Once containers and connectors may berecognized within the ink input, connectivity-based recognition may beperformed for recognizing a hand-drawn chart having connected areas suchas a pie chart, connected container recognition may be performed forrecognizing a hand-drawn chart having connected containers such a cyclediagram, and curve recognition may be performed for recognizing ahand-drawn chart having a curve or line. Moreover, connected containerrecognition may recognize hand-drawn diagrams or charts that may includeintersecting containers such as a Venn diagram and may also recognizehand-drawn diagrams or charts with a container that may entirely includeanother container such as a target diagram.

Advantageously, the system and method are insensitive to stroke inputorder and the number of strokes that may form a hand-drawn chart.Furthermore, the system and method may be used to detect any type ofchart by providing an appropriate type of chart recognizer. Once thetype of diagram or chart may be recognized, the shape of the chart maybe refined and drawn.

Other advantages will become apparent from the following detaileddescription when taken in conjunction with the drawings, in which:

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram generally representing a computer system intowhich the present invention may be incorporated;

FIG. 2 is a block diagram generally representing an exemplaryarchitecture of system components for recognition of hand-drawn chartsin ink input, in accordance with an aspect of the present invention;

FIG. 3 is a flowchart generally representing the steps undertaken forrecognition of hand-drawn charts in ink input, in accordance with anaspect of the present invention;

FIG. 4 is an exemplary illustration generally representing a structuralrelationship of handwritten objects in ink input for use in performingrecognition of hand-drawn objects, in accordance with an aspect of thepresent invention;

FIGS. 5A-5D are exemplary illustrations generally representing types ofdiagrams or charts that may be recognized by connectivity-basedrecognition, in accordance with an aspect of the present invention;

FIGS. 6A-6F are exemplary illustrations generally representing types ofdiagrams or charts that may be recognized by connected containerrecognition, in accordance with an aspect of the present invention;

FIGS. 7A-7B are exemplary illustrations generally representing types ofdiagrams or charts that may be recognized by curve recognition, inaccordance with an aspect of the present invention;

FIG. 8 is a flowchart generally representing one embodiment of the stepsundertaken for performing chart recognition of the type of diagram(s)and/or chart(s) formed by the closed containers and unclosed connectorsrecognized in ink input, in accordance with an aspect of the presentinvention;

FIG. 9 is a flowchart generally representing one embodiment of the stepsundertaken for performing connectivity-based recognition of the closedcontainers and unclosed connectors recognized in ink input, inaccordance with an aspect of the present invention;

FIGS. 10A-10D are exemplary illustrations generally representing typesof diagrams or charts recognized by connectivity-based recognition forwhich shape refinement has been performed, in accordance with an aspectof the present invention;

FIG. 11 is a flowchart generally representing one embodiment of thesteps undertaken for building a connectivity graph of the containers andconnectors recognized in the ink input, in accordance with an aspect ofthe present invention;

FIG. 12 is a flowchart generally representing one embodiment of thesteps undertaken for performing pie chart recognition from aconnectivity graph of the containers and connectors recognized in inkinput, in accordance with an aspect of the present invention;

FIG. 13 is a flowchart generally representing one embodiment of thesteps undertaken for performing bar chart recognition from aconnectivity graph of the containers and connectors recognized in inkinput, in accordance with an aspect of the present invention;

FIG. 14 is a flowchart generally representing one embodiment of thesteps undertaken for performing pyramid diagram recognition from aconnectivity graph of the containers and connectors recognized in inkinput, in accordance with an aspect of the present invention;

FIG. 15 is a flowchart generally representing one embodiment of thesteps undertaken for performing connected container recognition of theclosed containers and unclosed connectors recognized in the ink input,in accordance with an aspect of the present invention;

FIGS. 16A-16C are exemplary illustrations generally representing typesof diagrams or charts recognized by connected container recognition forwhich shape refinement has been performed, in accordance with an aspectof the present invention;

FIG. 17 is a flowchart generally representing one embodiment of thesteps undertaken for performing cycle diagram recognition from thecontainers and connectors recognized in ink input, in accordance with anaspect of the present invention;

FIG. 18 is a flowchart generally representing one embodiment of thesteps undertaken for performing radial diagram recognition from thecontainers and connectors recognized in ink input, in accordance with anaspect of the present invention;

FIG. 19 is a flowchart generally representing one embodiment of thesteps undertaken for performing organizational chart recognition fromthe containers and connectors recognized in ink input, in accordancewith an aspect of the present invention;

FIG. 20 is a flowchart generally representing an embodiment of the stepsundertaken for performing connected container recognition ofintersecting containers recognized in the ink input, in accordance withan aspect of the present invention;

FIGS. 21A-21C are exemplary illustrations generally representing typesof diagrams or charts of intersecting containers recognized by connectedcontainer recognition for which shape refinement has been performed, inaccordance with an aspect of the present invention;

FIG. 22 is a flowchart generally representing one embodiment of thesteps undertaken for performing target diagram recognition from thecontainers recognized in ink input, in accordance with an aspect of thepresent invention;

FIG. 23 is a flowchart generally representing one embodiment of thesteps undertaken for performing Venn diagram recognition from thecontainers recognized in ink input, in accordance with an aspect of thepresent invention;

FIG. 24 is a flowchart generally representing one embodiment of thesteps undertaken for performing curve recognition of drawing strokes inthe ink input, in accordance with an aspect of the present invention;

FIGS. 25A and 25B provide exemplary illustrations generally representingtypes of diagrams or charts recognized by curve recognition for whichshape refinement has been performed, in accordance with an aspect of thepresent invention;

FIG. 26 is a flowchart generally representing one embodiment of thesteps undertaken for performing reference frame detection for thedrawing strokes in the ink input, in accordance with an aspect of thepresent invention;

FIG. 27 is a flowchart generally representing one embodiment of thesteps undertaken for performing curve recognition of a polyline formedby drawing strokes of ink input, in accordance with an aspect of thepresent invention; and

FIG. 28 is an exemplary illustration generally representing a structuralrelationship of handwritten objects in ink input after performing chartrecognition, in accordance with an aspect of the present invention.

DETAILED DESCRIPTION

Exemplary Operating Environment

FIG. 1 illustrates an example of a suitable computing system environment100 on which the invention may be implemented. The computing systemenvironment 100 is only one example of a suitable computing environmentand is not intended to suggest any limitation as to the scope of use orfunctionality of the invention. Neither should the computing environment100 be interpreted as having any dependency or requirement relating toany one or combination of components illustrated in the exemplaryoperating environment 100.

The invention is operational with numerous other general purpose orspecial purpose computing system environments or configurations.Examples of well known computing systems, environments, and/orconfigurations that may be suitable for use with the invention include,but are not limited to: personal computers, server computers, hand-heldor laptop devices, tablet devices, headless servers, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputers, mainframe computers,distributed computing environments that include any of the above systemsor devices, and the like.

The invention may be described in the general context ofcomputer-executable instructions, such as program modules, beingexecuted by a computer. Generally, program modules include routines,programs, objects, components, data structures, and so forth, whichperform particular tasks or implement particular abstract data types.The invention may also be practiced in distributed computingenvironments where tasks are performed by remote processing devices thatare linked through a communications network. In a distributed computingenvironment, program modules may be located in local and/or remotecomputer storage media including memory storage devices.

With reference to FIG. 1, an exemplary system for implementing theinvention includes a general purpose computing device in the form of acomputer 110. Components of the computer 110 may include, but are notlimited to, a processing unit 120, a system memory 130, and a system bus121 that couples various system components including the system memoryto the processing unit 120. The system bus 121 may be any of severaltypes of bus structures including a memory bus or memory controller, aperipheral bus, and a local bus using any of a variety of busarchitectures. By way of example, and not limitation, such architecturesinclude Industry Standard Architecture (ISA) bus, Micro ChannelArchitecture (MCA) bus, Enhanced ISA (EISA) bus, Video ElectronicsStandards Association (VESA) local bus, and Peripheral ComponentInterconnect (PCI) bus also known as Mezzanine bus.

The computer 110 typically includes a variety of computer-readablemedia. Computer-readable media can be any available media that can beaccessed by the computer 110 and includes both volatile and nonvolatilemedia, and removable and non-removable media. By way of example, and notlimitation, computer-readable media may comprise computer storage mediaand communication media. Computer storage media includes volatile andnonvolatile, removable and non-removable media implemented in any methodor technology for storage of information such as computer-readableinstructions, data structures, program modules or other data. Computerstorage media includes, but is not limited to, RAM, ROM, EEPROM, flashmemory or other memory technology, CD-ROM, digital versatile disks (DVD)or other optical disk storage, magnetic cassettes, magnetic tape,magnetic disk storage or other magnetic storage devices, or any othermedium which can be used to store the desired information and which canaccessed by the computer 110. Communication media typically embodiescomputer-readable instructions, data structures, program modules orother data in a modulated data signal such as a carrier wave or othertransport mechanism and includes any information delivery media. Theterm “modulated data signal” means a signal that has one or more of itscharacteristics set or changed in such a manner as to encode informationin the signal. By way of example, and not limitation, communicationmedia includes wired media such as a wired network or direct-wiredconnection, and wireless media such as acoustic, RF, infrared and otherwireless media. Combinations of the any of the above should also beincluded within the scope of computer-readable media.

The system memory 130 includes computer storage media in the form ofvolatile and/or nonvolatile memory such as read only memory (ROM) 131and random access memory (RAM) 132. A basic input/output system 133(BIOS), containing the basic routines that help to transfer informationbetween elements within computer 110, such as during start-up, istypically stored in ROM 131. RAM 132 typically contains data and/orprogram modules that are immediately accessible to and/or presentlybeing operated on by processing unit 120. By way of example, and notlimitation, FIG. 1 illustrates operating system 134, applicationprograms 135, other program modules 136 and program data 137.

The computer 110 may also include other removable/non-removable,volatile/nonvolatile computer storage media. By way of example only,FIG. 1 illustrates a hard disk drive 141 that reads from or writes tonon-removable, nonvolatile magnetic media, a magnetic disk drive 151that reads from or writes to a removable, nonvolatile magnetic disk 152,and an optical disk drive 155 that reads from or writes to a removable,nonvolatile optical disk 156 such as a CD ROM or other optical media.Other removable/non-removable, volatile/nonvolatile computer storagemedia that can be used in the exemplary operating environment include,but are not limited to, magnetic tape cassettes, flash memory cards,digital versatile disks, digital video tape, solid state RAM, solidstate ROM, and the like. The hard disk drive 141 is typically connectedto the system bus 121 through a non-removable memory interface such asinterface 140, and magnetic disk drive 151 and optical disk drive 155are typically connected to the system bus 121 by a removable memoryinterface, such as interface 150.

The drives and their associated computer storage media, discussed aboveand illustrated in FIG. 1, provide storage of computer-readableinstructions, data structures, program modules and other data for thecomputer 110. In FIG. 1, for example, hard disk drive 141 is illustratedas storing operating system 144, application programs 145, other programmodules 146 and program data 147. Note that these components can eitherbe the same as or different from operating system 134, applicationprograms 135, other program modules 136, and program data 137. Operatingsystem 144, application programs 145, other program modules 146, andprogram data 147 are given different numbers herein to illustrate that,at a minimum, they are different copies. A user may enter commands andinformation into the computer 110 through input devices such as atablet, or electronic digitizer, 164, a microphone 163, a keyboard 162and pointing device 161, commonly referred to as mouse, trackball ortouch pad. Other input devices not shown in FIG. 1 may include ajoystick, game pad, satellite dish, scanner, or other devices includinga device that contains a biometric sensor, environmental sensor,position sensor, or other type of sensor. These and other input devicesare often connected to the processing unit 120 through a user inputinterface 160 that is coupled to the system bus, but may be connected byother interface and bus structures, such as a parallel port, game portor a universal serial bus (USB). A monitor 191 or other type of displaydevice is also connected to the system bus 121 via an interface, such asa video interface 190. The monitor 191 may also be integrated with atouch-screen panel or the like. Note that the monitor and/or touchscreen panel can be physically coupled to a housing in which thecomputing device 110 is incorporated, such as in a tablet-type personalcomputer. In addition, computers such as the computing device 110 mayalso include other peripheral output devices such as speakers 194 andprinter 195, which may be connected through an output peripheralinterface 193 or the like.

The computer 110 may operate in a networked environment using logicalconnections to one or more remote computers, such as a remote computer180. The remote computer 180 may be a personal computer, a server, arouter, a network PC, a peer device or other common network node, andtypically includes many or all of the elements described above relativeto the computer 110, although only a memory storage device 181 has beenillustrated in FIG. 1. The logical connections depicted in FIG. 1include a local area network (LAN) 171 and a wide area network (WAN)173, but may also include other networks. Such networking environmentsare commonplace in offices, enterprise-wide computer networks, intranetsand the Internet. When used in a LAN networking environment, thecomputer 110 is connected to the LAN 171 through a network interface oradapter 170. When used in a WAN networking environment, the computer 110typically includes a modem 172 or other means for establishingcommunications over the WAN 173, such as the Internet. The modem 172,which may be internal or external, may be connected to the system bus121 via the user input interface 160 or other appropriate mechanism. Ina networked environment, program modules depicted relative to thecomputer 110, or portions thereof, may be stored in the remote memorystorage device. By way of example, and not limitation, FIG. 1illustrates remote application programs 185 as residing on memory device181. It will be appreciated that the network connections shown areexemplary and other means of establishing a communications link betweenthe computers may be used.

Recognition of a Hand-Drawn Chart

The present invention is generally directed towards a system and methodfor recognition of a hand-drawn diagram or chart in ink input. As usedherein, a hand-drawn object or drawing object may mean any handwrittennon-character shape or drawing. A hand-drawn chart may mean anyhandwritten diagram or chart, including without limitation a pie chart,a bar chart, a cycle diagram, a Venn diagram, and so forth. A user maydraw diagrams and charts freely without restrictions on the hand-drawninput. A hand-drawn chart may have many strokes and the input order ofstrokes may be arbitrary so that the system and method may accept anyink as input. As used herein, ink generally means a handwritten strokeor strokes. Moreover, the strokes could be over-traced or overlapped.For either case, the system and method may automatically detect thecorrect shapes of the hand-drawn objects.

In specific, the system and method may detect the hand-drawn shape ofcontainers and connectors in ink input. As used herein, a containermeans any closed drawing object, and a connector means any drawingobject joining containers. Next, shape recognition may be performed foreach container and each connector detected within the ink input. Then,chart recognition may be performed for containers and connectorsrecognized within the ink input.

As will be seen, a drawing may then be generated for each hand-drawnchart recognized within the ink input. To generate a drawing from arecognized hand-drawn chart, content detection and shape refinement maybe performed. As will be understood, the various block diagrams, flowcharts and scenarios described herein are only examples, and there aremany other scenarios to which the present invention will apply.

Turning to FIG. 2 of the drawings, there is shown a block diagramgenerally representing an exemplary architecture of system componentsfor recognition of hand-drawn charts in ink input. Those skilled in theart will appreciate that the functionality implemented within the blocksillustrated in the diagram may be implemented as separate components orthe functionality of several or all of the blocks may be implementedwithin a single component. For example, the functionality for the chartdetector 204 may be included in the shape recognizer 210. Or thefunctionality of the container detector 206 may be implemented as aseparate component from the chart detector 204.

The ink parser 202 may accept any ink, including ink with a drawingobject. The ink parser 202 may include an operably coupled chartdetector 204, an operably coupled shape recognizer 210, and an operablycoupled chart recognizer 216. In general, the chart detector 204, theshape recognizer 210, and the chart recognizer 216 may be any type ofexecutable software code such as a kernel component, an applicationprogram, a linked library, an object, and so forth. The chart detector204 may include an operably coupled container detector 206 and anoperably coupled connector detector 208. In an embodiment, the containerdetector 206 may find the strokes that belong to a container and theconnector detector 208 may find the strokes that belong to a connectoras described in more detail in U.S. patent application Ser. No.10/850,948 entitled “System And Method For Detecting a Hand-Drawn Objectin Ink Input,” assigned to the same assignee as the present invention.The shape recognizer 210 may include an operably coupled containerrecognizer 212 and an operably coupled connector recognizer 214. In anembodiment, the container recognizer 212 may be used to recognize closedcontainers and the connector recognizer may be used to recognizeunclosed connectors in a drawing such as a diagram or chart as describedin more detail in U.S. patent application Ser. No. 10/850,718 entitled“System And Method For Shape Recognition of Hand-Drawn Objects,”assigned to the same assignee as the present invention.

The chart recognizer 216 may include an operably coupledconnectivity-based recognizer 218, an operably coupled connectedcontainer recognizer 226, and an operably coupled curve recognizer 238.The connectivity-based recognizer 218 may include any number of operablycoupled recognizers for recognition of a diagram or chart with connectedareas such as a pie chart recognizer 220, a bar graph recognizer 222, apyramid diagram recognizer 224, and so forth. The connected containerrecognizer 226 may include any number of operably coupled recognizersfor recognition of a diagram or chart with connected or intersectingcontainers such as cycle diagram recognizer 228, radial diagramrecognizer 230, target diagram recognizer 232, Venn diagram recognizer234, organizational chart recognizer 236, and so forth. The curverecognizer 238 may include any number of operably coupled recognizersfor recognition of curves such as line recognizer 240, normaldistribution recognizer 242, exponential curve recognizer 244,logarithmic curve recognizer 246, and so forth. Each of these componentsmay also be any type of executable software code such as a kernelcomponent, an application program, a linked library, an object, or othertype of executable software code.

FIG. 3 presents a flowchart generally representing the steps undertakenfor recognition of hand-drawn charts in ink input. At step 302, any inkmay be parsed, including ink with a drawing object. For instance, in oneembodiment, a page of ink may be accepted as input and parsed. In thisembodiment, the ink parser, for example, may have no a priori knowledgeof the ink on the page. Therefore, fundamental algorithms such as wordgrouping, writing/drawing classification and drawing grouping may beexecuted. In order to perform word grouping, strokes may be grouped intohierarchies of words, lines, and blocks. To do so, the word groupingprocess may include feature extraction of strokes to captures distance,geometric dissimilarity and linearity, and other stroke features. Theword grouping process may also include dynamic programming to group thestrokes according to temporal information. The word grouping process mayalso include clustering to group the strokes according to spatialinformation. The words, lines and blocks identified in the groups maynot necessarily correspond to real semantic words, lines and blocks. Infact, these groups may include strokes of hand-drawn objects.

To perform writing/drawing classification, various features may beidentified that may differentiate writing from drawing. For instance,single word features such as curvature, density, and other handwritingmodel features, may be used to differentiate writing from drawing. Inone embodiment, context features such as temporal and spatial contextfeatures, may be used to differentiate writing from drawing. Each of thevarious features may be mapped to a fuzzy function, and classificationbetween writing and drawing may be determined according to a combinationof the fuzzy functions.

After performing word grouping and writing/drawing classification, thedrawing strokes may be well organized by performing drawing grouping. Toperform drawing grouping, the drawing strokes may be grouped intoindependent objects according to the spatial relationship among them. Anefficient grid-based approach may be used for fitting the ink strokesinto an image grid with an appropriate size. The image grid may belabeled to find connected components. Each connected component maycorrespond to a drawing object. Heuristic rules may then be applied toadjust the drawing objects.

At step 304, chart detection may be performed to group drawing strokesby finding all the strokes that may belong to a drawing object. Thus auser can draw diagrams and charts freely without any restriction on theinput. For instance, one shape may have many strokes and the input ordermay be arbitrary. Moreover, the strokes could be over-traced oroverlapped. For any of these cases, the system may automatically detectthe correct shapes. In one embodiment, a hypergraph may be used torepresent the diagrams and flow chart so that the relationship betweencontainers and connectors may be fully represented. Thus, connectorsthat may join more than two containers may be supported in thisembodiment.

In an embodiment, the container detector 206 may find the strokes thatbelong to a container and the connector detector 208 may find thestrokes that belong to a connector as described in more detail in U.S.patent application Ser. No. 10/850,948 entitled “System And Method ForDetecting a Hand-Drawn Object in Ink Input,” assigned to the sameassignee as the present invention. For example, an optimal search may beperformed in time order to detect any containers. An efficient searchmay also be performed to detect containers and connectors. Finally,content detection may be performed for each detected container.

At step 306, shape recognition may be performed to recognize containersand connectors. After all of the strokes have been grouped for eachcontainer and each connector, the shape recognizer 210, in anembodiment, may be used to recognize closed containers and unclosedconnectors in a drawing such as a diagram or chart as described in moredetail in U.S. patent application Ser. No. 10/850,718 entitled “SystemAnd Method For Shape Recognition of Hand-Drawn Objects,” assigned to thesame assignee as the present invention. When recognized, the type,location, orientation and size of the shape can be provided.Advantageously, the order of stroke input and the number of strokes donot affect the recognition.

When shape recognition has been performed to recognize the closedcontainers and unclosed connectors, chart recognition may be performedat step 310 to recognize the type of diagram(s) and/or chart(s) formedby the closed containers and unclosed connectors recognized in the inkinput. To do so, connectivity-based recognition may be performed inorder to recognize any diagram or chart with connected areas such as apie chart, a bar graph, a pyramid diagram, and so forth. Connectedcontainer recognition may also be performed in order to recognize anydiagram or chart with connected or intersecting containers such as acycle diagram, a radial diagram, a target diagram, a Venn diagram, anorganizational chart, and so forth. Finally, curve recognition may beperformed to recognize any diagram or chart with a curve such as a linesegment, a normal distribution curve, an exponential curve, alogarithmic curve, and so forth. When chart recognition has beenperformed to recognize the diagram(s) and/or chart(s), the drawing ofthe diagram(s) and/or chart(s) may be generated at step 310.

FIG. 4 presents an exemplary illustration generally representing astructural relationship of handwritten objects in ink input for use inperforming recognition of hand-drawn objects. Root 402 may represent inkinput, such as a page of ink input, that may include one or more drawingobjects such as drawing objects 404 and 406. Drawing object 404 may haveassociated content such as text which may be structurally represented byparagraph 408 that may be made of line 410 which has a word 412 formedby strokes 414. Drawing objects 404 and 406 may be detected andrecognized by performing detection and shape recognition of thehand-drawn objects within the ink input. The hand-drawn objects may be adrawing such as a diagram or a chart that may then be recognized byperforming chart recognition.

FIGS. 5A-5D provide exemplary illustrations generally representing typesof diagrams or charts that may be recognized, for example, byconnectivity-based recognition. These types of diagrams or charts mayinclude connected areas. For example, pie chart 502 in FIG. 5A mayinclude connected areas 504, 506, 508 and 510. Pie chart 512 in FIG. 5Bmay include connected areas 514 and 516. Bar chart 518 in FIG. 5C mayinclude connected areas 520, 522 and 524. And pyramid diagram 526 inFIG. 5D may include connected areas 528, 530, 532 and 534.

FIGS. 6A-6F provide exemplary illustrations generally representing typesof diagrams or charts that may be recognized, for example, by connectedcontainer recognition. These types of diagrams or charts may includeconnected or intersecting containers. For example, circle diagram 602 inFIG. 6A may include connected containers 604, 606, 608, 610, 612 and614. Radial diagram 616 in FIG. 6B may include connected containers 618,620, 622, 624, 626, and 628. Organizational chart 630 in FIG. 6C mayinclude connected containers 632, 634, 636, 638, 640, 642, 644, and 646.Target diagram 648 in FIG. 6D may include intersecting containers 650,652, 654, and 656. Venn diagram 658 in FIG. 6E may include intersectingcontainers 660, 662 and 664. And Venn diagram 666 may includeintersecting containers 668, 670, 672, 674, 676, and 678.

FIGS. 7A-7B provide exemplary illustrations generally representing typesof diagrams or charts that may be recognized, for example, by curverecognition. These types of diagrams or charts may include a linesegment or curve. For example, chart 702 in FIG. 7A may include normaldistribution curves 704 and 706. And chart 708 in FIG. 7B may includeline segment 710, logarithmic curve 712, and exponential curve 714.

FIG. 8 presents a flowchart generally representing one embodiment of thesteps undertaken for performing chart recognition of the type ofdiagram(s) and/or chart(s) formed by the closed containers and unclosedconnectors recognized in the ink input. Connectivity-based recognitionmay be performed at step 802 to recognized types of diagrams or chartsthat may include connected areas, such as a pie chart, a bar chart, apyramid chart and so forth. Next, connected container recognition may beperformed at step 804 to recognize types of diagrams or charts that mayinclude connected containers or intersecting containers such as a cyclediagram, a radial diagram, an organizational chart, a target diagram, aVenn diagram, and so forth. In an embodiment, connected containerrecognition may be performed at step 806 for connected containers andthen connected container recognition may be performed at step 808 forintersecting containers. At step 810, curve recognition may then beperformed to recognize types of diagrams or charts that may include aline segment or curve such as a normal distribution, a logarithmiccurve, an exponential curve, and so forth.

FIG. 9 presents a flowchart generally representing one embodiment of thesteps undertaken for performing connectivity-based recognition of theclosed containers and unclosed connectors recognized in the ink input.At step 902, a connectivity graph of the recognized containers andrecognized connectors may be built. At step 904, pie chart recognitionmay be performed for the connectivity graph built. Next, it may bedetermined at step 906 whether a pie chart may be recognized from theconnectivity graph. If so, then content detection may be performed atstep 916. Otherwise, bar chart recognition may be performed for theconnectivity graph at step 908. It may be determined at step 910 whethera bar chart may be recognized from the connectivity graph. If so, thencontent detection may be performed at step 916. Otherwise, pyramiddiagram recognition may be performed for the connectivity graph at step912. It may be determined at step 914 whether a pyramid diagram may berecognized from the connectivity graph. If so, then content detectionmay be performed at step 916. Otherwise, processing may be finished.

In an embodiment, content detection may be performed for each text wordby determining the intersection between its bounding box and eachconnected area. If the largest area ratio between the intersection andthe word's bounding box is greater than 0.8, it may be considered to bethe content of the corresponding connected area.

The shape of the recognized diagram or chart may be refined at step 918.For example, the ratios between the fans of a pie chart may be adjustedto accommodate any recognized contents corresponding to the connectedareas of the pie chart. In the case of a bar graph, the heights of thebars may be adjusted, for example, to accommodate any recognizedcontents corresponding to the connected areas of the bar chart. Thewidths of the bars may also be adjusted to be the same width and thepositions of the bar clusters may be adjusted to be the same distanceapart. Shape refinement may also be performed for pyramid diagrams. Forexample, the layers of a pyramid diagram may be adjusted to be the sameheight.

FIGS. 10A-10D provide exemplary illustrations generally representingtypes of diagrams or charts recognized by connectivity-based recognitionfor which shape refinement has been performed. For example, pie chart1002 in FIG. 10A may illustrate the result of shape refinement afterrecognition of hand-drawn pie chart 502 in FIG. 5A. Similarly, pie chart1004 in FIG. 10B may illustrate the result of shape refinement afterrecognition of hand-drawn pie chart 512 in FIG. 5B. Bar chart 1006 inFIG. 10C may illustrate the result of shape refinement after recognitionof hand-drawn bar chart 518 in FIG. 5C. And pyramid diagram 1008 in FIG.10D may illustrate the result of shape refinement after recognition ofhand-drawn pyramid diagram 526 in FIG. 5D.

FIG. 11 presents a flowchart generally representing one embodiment ofthe steps undertaken for building a connectivity graph of the containersand connectors recognized in the ink input. At step 1102, the polylineof each drawing stroke may be simplified. In one embodiment, thepolyline may be simplified by applying Sklansky's polyline approximation(which may be found in Sklansky J. and Gonzalez V., Fast PolygonalApproximation of Digitized Curves, Pattern Recognition, Vol. 12, pp.327-331, 1980). At step 1104, polylines may be merged. In an embodiment,the polylines may be merged using the method for merging skeletonstrokes or stroke pieces as described in more detail in U.S. patentapplication Ser. No. 10/850,718 entitled “System And Method For ShapeRecognition of Hand-Drawn Objects,” assigned to the same assignee as thepresent invention. At step 1106, weights for each polyline may be set.At step 1108, the intersection points of polylines may be determined. Inone embodiment, the regular intersection points of two arbitrary linesegments of the polylines may be determined, where the “regular” meansthat the intersection point is inside the two line segments. Next, thelength of the first and last line segments of each polyline may beprolonged by 25 percent of its length and the intersection points withother line segments may be determined by calculating the weight of theintersection points. For two line segment {overscore (AB)}and {overscore(CD)}, the weight of the intersection point M may be defined to be:weight(M)=max(min(weight(A),weight(B)),min(weight(C),weight(D))).

At step 1110, vertices may be iteratively merged. In an embodiment, thevertex pair with the least merging score may be iteratively merged untilthe least merging score exceeds a threshold. In an embodiment, thethreshold may be 0.15 and the merging score of two vertices may bedefined to be the distance between the two original points divided bythe minimal weight of the two vertices. It may then be determined atstep 1112 whether there may be more than one connected subgraph. If not,processing may be finished. Otherwise, the connectivity graph may bedivided into multiple connectivity graphs at step 1114. Then a mappingof the polylines of the drawing strokes and edges of the graph may beperformed at step 1116 and processing may be finished. In oneembodiment, the mapping of the polylines of the drawing strokes andedges of the graph may be accomplished by computing the nearest edge inthe graph of each line segment of the original polylines.

FIG. 12 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing pie chart recognition from aconnectivity graph of the containers and connectors recognized in inkinput. At step 1202, connected areas of the connectivity graph that mayshare one vertex may be found. In an embodiment, each single connectedarea may be detected by applying the line arrangement methods (which maybe found in Joseph O'Rourke, Computational Geometry in C, pp. 205-212.Cambridge University Press, New York, 1994.)

At step 1204, edges of the connectivity graph that are not shared byconnected areas may be found. It may be determined at step 1206 whetherthe edges of the connectivity graph that are not shared by connectedareas form a recognizable circle. In an embodiment, shape recognitionmay be performed upon the edges by using the method for recognizing theshape of a circle from drawing strokes as described in more detail inU.S. patent application Ser. No. 10/850,718 entitled “System And MethodFor Shape Recognition of Hand-Drawn Objects,” assigned to the sameassignee as the present invention.

If the edges of the connectivity graph that are not shared by connectedareas do not form a recognizable circle, then an indication that a piechart is not recognized may be returned at step 1214. If so, then thedistance between the shared vertex and the center of the recognizedcircle may be determined at step 1208. It may then be determined at step1210 whether the distance between the shared vertex and the center ofthe recognized circle may be less than the weighted radius of therecognized circle. If not, then an indication that a pie chart is notrecognized may be returned at step 1214. If so, then it may bedetermined at step 1212 whether the edges between the shared vertex andthe recognized circle are line segments. In an embodiment, the minimalbounding box of the polylines may be determined and, if the ratiobetween maximum(height, width) and minimum(height, width) of thebounding box may be greater than 5, then the polylines are considered tobe a line segment. If not, then an indication that a pie chart is notrecognized may be returned at step 1214. Otherwise, if the edges fromthe vertex of the recognized circle are line segments then an indicationthat a pie chart is recognized may be returned at step 1216 andprocessing may be finished.

FIG. 13 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing bar chart recognition from aconnectivity graph of the containers and connectors recognized in inkinput. At step 1302, it may be determined whether each connected area ofthe connectivity graph may be a rectangle. If not, then an indicationthat a bar chart is not recognized may be returned at step 1314.Otherwise, if each connected area of the connectivity graph may be arectangle, then the difference of the direction of each rectangularconnected area may be determined at step 1304. The direction of arectangle may be defined to be the angle between the longer edge andY-axis. It may then be determined at step 1306 whether the difference ofthe direction of each rectangular connected area may be greater than 20degrees. In an embodiment, the difference between direction A and B maybe defined to be min(|A−B|,|π/2−A+B|). If the difference of thedirection of each rectangular connected area may be greater than 20degrees, then an indication that a bar chart is not recognized may bereturned at step 1314. If difference of the direction of eachrectangular connected area may not be greater than 20 degrees, then themajor direction of the rectangular connected areas may be determined atstep 1308. The major direction may be determined by computing the meanvalue of the directions (or the complementary angles) of the rectangularconnected areas. Next, the two edges of each rectangular connected areathat may be perpendicular to the major direction may be classified atstep 1310 into two groups. In an embodiment, the edge that may befarther from the origin may be classified into a first group and theother edge may be classified into a second group. It may then bedetermined at step 1312 whether all the edges from one of the groups maybe on a line segment. In an embodiment, it may be determined whether theedges may be connected and their original polylines could be a linesegment by computing the minimal bounding box of the polylines and, ifthe ratio between maximum(height, width) and minimum(height, width) ofthe bounding box may be greater than 5, then the polylines areconsidered to be a line segment. If not, then an indication that a barchart is not recognized may be returned at step 1314. If so, then anindication that a bar chart is recognized may be returned at step 1316.The shared line segment may be considered the X-axis of the bar graph.The Y-axis may be recognized from the edges perpendicular to X-axis. Andthe arrow heads of the X and Y axis may be recognized using the shaperecognizer.

FIG. 14 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing pyramid diagram recognition from aconnectivity graph of the containers and connectors recognized in inkinput. At step 1402, connected areas of the connectivity graph may befound. At step 1404, edges of the connectivity graph that are not sharedby connected areas may be found. It may be determined at step 1406whether the edges of the connectivity graph that are not shared byconnected areas form a recognizable triangle. In one embodiment, it maybe determined whether the edges form an isosceles triangle. If not, thenan indication that a pyramid diagram is not recognized may be returnedat step 1414. If the edges of the connectivity graph that are not sharedby connected areas form a recognizable triangle, then shape recognitionmay be performed for each connected area at step 1408. It may then bedetermined at step 1410 whether there is one connected area that may bea triangle. If not, then an indication that a pyramid diagram is notrecognized may be returned at step 1414. Otherwise, then it may bedetermined at step 1412 whether the other connected areas may betrapezoids. If the other connected areas may not be trapezoids, then anindication that a pyramid diagram is not recognized may be returned atstep 1414. If the other connected areas may be trapezoids, then anindication that a pyramid diagram is recognized may be returned at step1416.

FIG. 15 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing connected container recognition ofthe closed containers and unclosed connectors recognized in the inkinput. At step 1502, it may be determined whether there are anyconnected containers recognized in the ink input. If not, processing maybe finished. Otherwise, cycle diagram recognition may be performed atstep 1504. Next, it may be determined at step 1506 whether a cyclediagram may be recognized from the connected containers. If so, thencontent detection may be performed at step 1516. Otherwise, radialdiagram recognition may be performed at step 1508. It may be determinedat step 1510 whether a radial diagram may be recognized from theconnected containers. If so, then content detection may be performed atstep 1516. Otherwise, organizational chart recognition may be performedat step 1512. It may be determined at step 1514 whether anorganizational chart may be recognized from the connected containers. Ifso, then content detection may be performed at step 1516. Otherwise,processing may be finished.

In an embodiment, content detection may be performed for each text wordby determining the intersection between its bounding box and eachconnected area. If the largest area ratio between the intersection andthe word's bounding box is greater than 0.8, it may be considered to bethe content of the corresponding connected area.

The shape of the recognized diagram or chart may be refined at step1518. For example, the radius of each circle in a cycle diagram may beset to the mean radius of all the containers and each circle may beevenly distributed around the barycenter of the diagram. In the case ofa radial diagram, the radius of each circle in a radial diagram may beset to the mean radius of all the containers and each container with onerelated connector may be evenly distributed around the centroidcontainer. Shape refinement may also be performed for organizationalcharts. For example, each rectangular container may be set to the meansize of the rectangular containers recognized. Also, the verticaldistances between rectangular containers may be set to be the samedistance apart and the horizontal distances between rectangularcontainers may be set to be the same distance apart.

FIGS. 16A-16C provide exemplary illustrations generally representingtypes of diagrams or charts recognized by connected containerrecognition for which shape refinement has been performed. For example,cycle diagram 1602 in FIG. 16A may illustrate the result of shaperefinement after recognition of hand-drawn cycle diagram 602 in FIG. 6A.Similarly, radial diagram 1604 in FIG. 16B may illustrate the result ofshape refinement after recognition of hand-drawn radial diagram 616 inFIG. 6B. And organizational chart 1606 in FIG. 16C may illustrate theresult of shape refinement after recognition of hand-drawnorganizational chart 630 in FIG. 6C.

FIG. 17 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing cycle diagram recognition from thecontainers and connectors recognized in ink input. At step 1702, it maybe determined whether there are at least three containers among thecontainers recognized in ink input. If not, then an indication that acycle diagram is not recognized may be returned at step 1718. Otherwise,it may be determined at step 1704 whether the number of containersequals the number of connectors. If not, then an indication that a cyclediagram is not recognized may be returned at step 1718. If the number ofcontainers equals the number of connectors, next it may be determined atstep 1706 whether each connector connects only two containers. If so,then it may be determined at step 1708 whether each connector has anarrow only at one end, else an indication that a cycle diagram is notrecognized may be returned at step 1718. If each connector does not havean arrow only at one end, then an indication that a cycle diagram is notrecognized may be returned at step 1718. Otherwise, it may be determinedat step 1710 whether the shape of each container may be a circle. Ifnot, then an indication that a cycle diagram is not recognized may bereturned at step 1718. If the shape of each container may be a circle,it may then be determined at step 1712 whether the ratio between theradius of the largest circle and the radius of the smallest circle maybe less than a specific threshold. In an embodiment, the threshold maybe 2. If the ratio is not less than the specific threshold, anindication that a cycle diagram is not recognized may be returned atstep 1718. If the ratio is less than the specific threshold, it may bedetermined at step 1714 whether the arrow of only one connector may bepointing toward each container. If so, then an indication that a cyclediagram is recognized may be returned at step 1716 and processing may befinished. Otherwise, an indication that a cycle diagram is notrecognized may be returned at step 1718 and processing may be finished.

FIG. 18 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing radial diagram recognition from thecontainers and connectors recognized in ink input. At step 1802, it maybe determined whether there are at least three containers among thecontainers recognized in ink input. If not, then an indication that aradial diagram is not recognized may be returned at step 1818.Otherwise, it may be determined at step 1804 whether the number ofcontainers equals the number of connectors plus one. If not, then anindication that a radial diagram is not recognized may be returned atstep 1818. If the number of containers equals the number of connectorsplus one, next it may be determined at step 1806 whether each connectorconnects only two containers. If so, then it may be determined at step1808 whether any connector has any arrows at its ends, else anindication that a radial diagram is not recognized may be returned atstep 1818. If any connector has any arrows at its ends, then anindication that a radial diagram is not recognized may be returned atstep 1818. Otherwise, it may be determined at step 1810 whether theshape of each container may be a circle. If not, then an indication thata radial diagram is not recognized may be returned at step 1818. If theshape of each container may be a circle, it may then be determined atstep 1812 whether the ratio between the radius of the largest circle andthe radius of the smallest circle may be less than a specific threshold.In an embodiment, the threshold may be 2. If the ratio is not less thanthe specific threshold, an indication that a radial diagram is notrecognized may be returned at step 1818. If the ratio is less than thespecific threshold, it may be determined at step 1814 whether only onecontainer may have more than one connector. If so, then an indicationthat a radial diagram is recognized may be returned at step 1816 andprocessing may be finished. Otherwise, an indication that a radialdiagram is not recognized may be returned at step 1818 and processingmay be finished.

FIG. 19 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing organizational chart recognitionfrom the containers and connectors recognized in ink input. At step1902, it may be determined whether the containers recognized in inkinput may be rectangles. If not, then an indication that anorganizational chart is not recognized may be returned at step 1924.Otherwise, it may be determined at step 1904 whether any connector hasany arrows at its ends. If any connector has any arrows at its ends,then an indication that an organizational chart is not recognized may bereturned at step 1924. Otherwise, an unvisited container may be selectedas a seed at step 1906. Next, the unvisited neighbors of the containerselected as a seed may be recorded as its children at step 1908. It maythen be determined at step 1910 whether the container selected as a seedhas more than one child. If so, then the regression line for the centerof each child may be iteratively determined at step 1912. It may bedetermined at step 1914 whether any container may have more than oneparent. If so, then an indication that an organizational chart is notrecognized may be returned at step 1924. If it is determined that eachcontainer may not have more than one parent at step 1914 or if it isdetermined that the container selected as a seed did not have more thanone child at step 1910, then it may be determined at step 1916 whetherthe angle between each rectangle and the corresponding regression linemay be less than 20 degrees. If so, then it may be determined at step1918 whether the maximal angle between all regression lines may be lessthan 20 degrees. If it is, then an indication that an organizationalchart is recognized may be returned at step 1922 and processing may befinished. If it is determined at step 1918 that the maximal anglebetween all regression lines may not be less than 20 degrees or it isdetermined at step 1916 that the angle between each rectangle and thecorresponding regression line may not be less than 20 degrees, then itmay be determined at step 1920 whether the container selected as a seedmay be the last unvisited container. If it is not, then processing maycontinue at step 1906 where another unvisited container may be selectedas a seed. If it is determined at step 1920 that the container selectedas a seed may be the last unvisited container, then an indication thatan organizational chart is not recognized may be returned at step 1924and processing may be finished.

FIG. 20 presents a flowchart generally representing an embodiment of thesteps undertaken for performing connected container recognition ofintersecting containers recognized in the ink input. At step 2002, itmay be determined whether there are any containers recognized in the inkinput without associated connectors. If not, processing may be finished.Otherwise, it may be determined at step 2004 whether the containers maybe circles. If so, target diagram recognition may be performed at step2006. It may be determined at step 2008 whether a target diagram may berecognized from the unconnected containers. If so, then contentdetection may be performed at step 2014. Otherwise, Venn diagramrecognition may be performed at step 2010. It may be determined at step2012 whether a Venn diagram may be recognized from the unconnectedcontainers. If so, then content detection may be performed at step 2014.Otherwise, processing may be finished.

In an embodiment, content detection may be performed for each text wordby determining the intersection between its bounding box and eachconnected area. If the largest area ratio between the intersection andthe word's bounding box is greater than 0.8, it may be considered to bethe content of the corresponding connected area.

The shape of the recognized diagram or chart may be refined at step2016. For example, all of the circles in a target diagram may be set tothe same center and the radiuses of the circles may be set to increaseevenly. In the case of a Venn diagram, the radius of each circle in aVenn diagram may be set to the mean radius of all the circles and thecenters of each circle may be evenly distributed around the barycenterof the diagram.

FIGS. 21A-21C provide exemplary illustrations generally representingtypes of diagrams or charts of intersecting containers recognized byconnected container recognition for which shape refinement has beenperformed. For example, target diagram 2102 in FIG. 21A may illustratethe result of shape refinement after recognition of hand-drawn targetdiagram 648 in FIG. 6D. Similarly, Venn diagram 2104 in FIG. 21B mayillustrate the result of shape refinement after recognition ofhand-drawn Venn diagram 658 in FIG. 6E. And Venn diagram 2106 in FIG.21C may illustrate the result of shape refinement after recognition ofhand-drawn Venn diagram 666 in FIG. 6F.

FIG. 22 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing target diagram recognition from thecontainers recognized in ink input. All the containers that may containa container may be grouped into a cluster at step 2202 and this step maybe performed for each container recognized in ink input. It may next bedetermined at step 2204 whether there are any circles intersectinganother circle within any cluster. If not, then an indication that atarget diagram is recognized may be returned at step 2206 and processingmay be finished. If there are any circles intersecting another circlewithin any cluster, then an indication that a target diagram is notrecognized may be returned at step 2208 and processing may be finished.

FIG. 23 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing Venn diagram recognition from thecontainers recognized in ink input. All the containers that mayintersect a container may be grouped into a cluster at step 2302 andthis step may be performed for each container recognized in ink input.It may next be determined at step 2304 whether there are any clusterswith more than two containers. If not, then an indication that a Venndiagram is not recognized may be returned at step 2320 and processingmay be finished. Otherwise, it may then be determined at step 2306whether the ratio between the radius of the largest circular containerand the radius of the smallest circular container may be greater than aspecific threshold. In an embodiment, the threshold may be 2. If theratio is not greater than the specific threshold, an indication that aVenn diagram is not recognized may be returned at step 2320. If theratio may be greater than the specific threshold, then the distancebetween the center of each circular container and the barycenter of thediagram may be determined at step 2308. It may next be determined atstep 2310 whether the ratio between the maximum distance and the minimumdistance may be greater than a specific threshold. In an embodiment, thethreshold may be 1.5. If not, then an indication that a Venn diagram isnot recognized may be returned at step 2320. Otherwise, the circularcontainers in each cluster may be sorted clockwise around the barycenterof the diagram at step 2312. Next, it may be determined at step 2314whether each circular container in each cluster may intersect theprevious and following circular containers. If so, then an indicationthat a Venn diagram is recognized may be returned at step 2318 andprocessing may be finished. Otherwise, it may be determined at step 2316whether there is any other unvisited cluster with more than twocontainers. If so, then processing may continue at step 2306. If it isdetermined at step 2316 that there may not be any other unvisitedcluster with more than two containers, then an indication that a Venndiagram is not recognized may be returned at step 2320 and processingmay be finished.

FIG. 24 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing curve recognition of drawing strokesin the ink input. At step 2402, reference frame detection may beperformed for the drawing strokes in the ink input. When a referenceframe may be detected, the X and Y axis of a detected reference framemay form a rectangle in an embodiment. At step 2404, the drawing strokeswithin a reference frame may then be found. For each drawing stroke, ifthe ratio between the length of the parts of the drawing stroke that maybe inside of the rectangle and the total length of the rectangle isgreater than 0.8, then the drawing stroke may be considered in oneembodiment to be inside the reference frame detected. Next, the drawingstrokes found within the reference frame may be merged at step 2406 toform polylines. In an embodiment, the polylines may be merged using themethod for merging skeleton strokes or stroke pieces as described inmore detail in U.S. patent application Ser. No. 10/850,718 entitled“System And Method For Shape Recognition of Hand-Drawn Objects,”assigned to the same assignee as the present invention.

A polyline may then be selected at step 2408 and line recognition may beperformed on the polyline at step 2410. It may then be determined atstep 2412 whether a line may be recognized from the polyline. If so,then processing may continue at step 2418 where shape refinement may beperformed. If it may be determined that a line may not be recognizedfrom the polyline at step 2412, then curve recognition may be performedat step 2414. Next, it may be determined at step 2416 whether a curvemay be recognized from the polyline. If not, then processing may befinished. Otherwise, if a curve may be recognized at step 2416, thenshape refinement may be performed at step 2418. It may then bedetermined whether there is any other polyline not yet selected at step2420. If there is another polyline not yet selected, then processing maycontinue at step 2408 where a polyline may be selected. Otherwise,processing may be finished.

In one embodiment, the shape of the recognized diagram or chart having aline or curve may be refined at step 2418. FIGS. 25A and 25B provideexemplary illustrations generally representing types of diagrams orcharts recognized by curve recognition for which shape refinement hasbeen performed. For example, chart 2502 in FIG. 25A may illustrate theresult of shape refinement after recognition of hand-drawn chart 702 inFIG. 7A. Similarly, chart 2504 in FIG. 25B may illustrate the result ofshape refinement after recognition of hand-drawn chart 708 in FIG. 7B.

FIG. 26 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing reference frame detection for thedrawing strokes in the ink input. At step 2602, the polyline of eachdrawing stroke may be simplified. In one embodiment, the polyline may besimplified by applying Sklansky's polyline approximation (which may befound in Sklansky J. and Gonzalez V., Fast Polygonal Approximation ofDigitized Curves, Pattern Recognition, Vol. 12, pp. 327-331, 1980). Thenline segments may be merged at step 2604. In an embodiment, thefollowing process may be iteratively repeated until no line segments canbe merged: the minimal bounding box between two arbitrary line segmentsof the polylines may be computed, and, if the ratio betweenmaximum(height, width) and minimum(height, width) of the bounding boxmay be greater than 5, the two line segments may be represented with thediagonal of the box.

After line segments may be merged at step 2604, a pair of intersectingline segments may be selected at step 2606. It may then be determined atstep 2608 whether the pair of intersecting line segments may bereference frame candidates. In an embodiment, a pair of intersectingline segments may be considered reference frame candidates if the anglebetween them may lie between [5π/12,7π/12]. If so, then it may bedetermined at step 2612 whether arrow heads may be recognized for eachline at the endpoints farthest from the intersection point of the lines.In an embodiment, all the drawing strokes may be found inside thecircles with centers at the endpoints farthest from the intersectionpoint of the lines and with radiuses of 20 millimeters. If an arrow headmay be recognized from each set of drawing strokes inside the circles,then the frame reference may be recognized and the X and Y axis of theframe reference may be determined at step 2614 using the right handrule.

If it is determined at step 2608 that the pair of intersecting linesegments may not be reference frame candidates or if it is determined atstep 2612 that arrow heads may not be recognized for each line at theendpoints farthest from the intersection point of the lines, then it maybe determined at step 2610 whether there may be another pair ofintersecting lines not yet selected. If there may be another pair notyet selected, then processing may continue at step 2606 where a pair ofintersecting line segments may be selected. Otherwise, processing may befinished.

FIG. 27 presents a flowchart generally representing one embodiment ofthe steps undertaken for performing curve recognition of a polylineformed by drawing strokes of ink input. At step 2702, the points of thepolyline may be resampled. Then the points of the polyline may betransformed at step 2704 with the origin of the frame reference. Forexample, the polyline may be resampled in an embodiment to 20 points(x_(i)′,y_(i)′) (1≦i≦20) with even sampling step and then the points maybe transformed with $\left\{ {\begin{matrix}{x_{i} = {{\left( {x_{i}^{\prime} - x_{0}} \right)*\cos\quad\theta} + {\left( {y_{0} - y_{i}^{\prime}} \right)*\sin\quad\theta}}} \\{y_{i} = {{\left( {x_{0} - x_{i}^{\prime}} \right)*\sin\quad\theta} + {\left( {y_{0} - y_{i}^{\prime}} \right)*\cos\quad\theta}}}\end{matrix},} \right.$where (x₀,y₀) are the coordinates of the detected reference frame'sorigin in global reference frame, θ is the angle between the two X-axisof the detected and global reference frame and (x_(i),y_(i)) are thecoordinates under detected reference frame.

The genetic algorithm may be applied to the transformed polyline at step2706. For example, for arbitrary curve y=f(x), the minimal value$Y = {\min\left( {\sum\limits_{i}{{{f\left( x_{i} \right)} - y_{i}}}} \right)}$may be computed in an embodiment with the optimization method of thegenetic algorithm. When the minimal value may be calculated, theparameters may also determined at step 2708. The parameters for curverecognition may be optimized for a normal distribution curve at step2710. For example, a normal distribution may be defined in an embodimentas${y = {\frac{b}{\sigma\sqrt{2\pi}}{\mathbb{e}}^{{- {({{ax} - u})}^{2}}/{({2\quad\sigma^{2}})}}}},$where a, b, u, σ are the parameters to be optimized. The parameters forcurve recognition may be optimized for a logarithmic curve at step 2712.For example, a logarithmic curve may be defined in an embodiment asy=cln(ax+b)+d, where a, b, c, d are the parameters to be optimized. Theparameters for curve recognition may be optimized for an exponentialcurve at step 2714. For example, an exponential curve may be defined inan embodiment as y=ce^((ax-b))−d, where a, b, c, d are the parameters tobe optimized. Then the type of curve with the least optimized value maybe selected at step 2716. Next it may be determined at step 2718 whethera curve may be recognized. If not, then an indication that a curve isnot recognized may be returned at step 2722 and processing may befinished. Otherwise, if a curve may be recognized, then an indication ofthe type of recognized curve selected may be returned at step 2720 andprocessing may be finished. In one embodiment, if the least optimizedvalue is less than 60, the polyline may be recognized as thecorresponding curve type.

Once the hand-drawn diagram or chart has been recognized, the structuralrelationship of diagram or chart may be understood. FIG. 28 is anexemplary illustration generally representing a structural relationshipof handwritten objects in ink input after performing chart recognition.Root 2802 may represent ink input, such as a page of ink input, that mayinclude one or more drawing objects such as drawing objects 2806. Adrawing object, such as chart 2804, may be recognized by performingchart recognition of the hand-drawn objects within the ink input. Chart2804 may be formed by containers 2808 and 2810 which are joined byconnector 2812. Container 2808 may include associated content such astext which may be structurally represented by paragraph 2814 that may bemade of line 2816 which has a word 2818 formed by strokes 2820.

After the containers and connectors have been recognized by thedescribed system and method, the structure of the hand-drawn objectswithin the ink input may be completely recognized and generated. Byusing the present invention, a user may draw diagrams and charts freelyand without restrictions on the hand-drawn input. One diagram or chartmay have many strokes and the input order of strokes may be arbitrary sothat the system and method may accept any ink as input. The structure ofthe diagram or chart may be recognized, its shape refined, and thendrawn.

As can be seen from the foregoing detailed description, the presentinvention provides a system and method for recognition of a hand-drawndiagram or chart in ink input. Advantageously, the system and method areinsensitive to stroke input order and the number of strokes that mayform a hand-drawn chart. Additionally, the system and method providedare flexible and extensible. As is now understood, the present inventionmay be used to detect any diagram or chart in a drawing including adiagram or chart with connected areas such as a pie chart, bar chart,pyramid diagram, and so forth. Moreover, the present invention may beused to detect any diagram or chart with connected containers such as acycle diagram, a radial diagram, an organizational chart, and so forth.Furthermore, the present invention may be used to detect any hand-drawndiagram or chart with intersecting containers such as a Venn diagram orwith a container that may include another container such as a targetdiagram. Once detected, a drawing may then be generated for eachhand-drawn chart recognized within the ink input. The method and systemthus provide significant advantages and benefits needed in contemporarycomputing.

While the invention is susceptible to various modifications andalternative constructions, certain illustrated embodiments thereof areshown in the drawings and have been described above in detail. It shouldbe understood, however, that there is no intention to limit theinvention to the specific forms disclosed, but on the contrary, theintention is to cover all modifications, alternative constructions, andequivalents falling within the spirit and scope of the invention.

1. A computer system for recognizing a hand-drawn chart in ink input,comprising: a chart recognizer for recognizing a hand-drawn chart fromclosed containers and unclosed connectors recognized in ink input; aconnectivity-based recognizer operably coupled to the chart recognizerfor recognizing a hand-drawn chart having connected areas; and aconnected container recognizer operably coupled to the chart recognizerfor recognizing a hand-drawn chart having connected containers.
 2. Thesystem of claim 1 further comprising a curve recognizer operably coupledto the chart recognizer for recognizing a hand-drawn chart having acurve.
 3. The system of claim 1 further comprising a chart detectoroperably coupled to the chart recognizer for receiving ink input, thechart detector comprising a container detector for detecting the closedcontainers within ink input and a connector detector for detecting theunclosed connectors within ink input.
 4. The system of claim 3 furthercomprising an ink parser operably coupled to the chart detector forsending ink input to the chart detector.
 5. The system of claim 4further comprising a shape recognizer operably coupled to the ink parserfor recognizing a hand-drawn shape.
 6. The system of claim 5 wherein theshape recognizer comprises a container recognizer operably coupled tothe shape recognizer.
 7. The system of claim 5 wherein the shaperecognizer comprises a connector recognizer operably coupled to theshape recognizer.
 8. A computer-readable medium havingcomputer-executable components comprising the system of claim
 1. 9. Amethod in a computer system for recognizing a hand-drawn chart in inkinput, comprising: receiving ink input; performing container detectionfor each container within the ink input; performing shape recognitionfor each container detected within the ink input; and performing chartrecognition for containers recognized within the ink input.
 10. Themethod of claim 9 further comprising performing shape recognition foreach connector detected within the ink input.
 11. The method of claim 10further comprising performing chart recognition for containers andconnectors recognized within the ink input.
 12. The method of claim 9further comprising generating a drawing for each hand-drawn chartrecognized within the ink input.
 13. The method of claim 9 whereinperforming chart recognition comprises performing connectivity-basedrecognition to recognize a hand-drawn chart having connected areas. 14.The method of claim 9 wherein performing chart recognition comprisesperforming connected container recognition to recognize a hand-drawnchart having connected containers.
 15. The method of claim 9 whereinperforming chart recognition comprises performing curve recognition torecognize a hand-drawn chart having a curve.
 16. The method of claim 15wherein performing curve recognition to recognize a hand-drawn charthaving a curve comprises performing curve recognition to recognize ahand-drawn chart having a line.
 17. The method of claim 14 whereinperforming connected container recognition to recognize a hand-drawnchart having connected containers comprises performing connectedcontainer recognition to recognize a hand-drawn chart havingintersecting containers.
 18. The method of claim 14 wherein performingconnected container recognition to recognize a hand-drawn chart havingconnected containers comprises performing connected containerrecognition to recognize a hand-drawn chart having a container includedentirely within another container.
 19. A computer-readable medium havingcomputer-executable instructions for performing the method of claim 9.20. A computer system for detecting a hand-drawn shape, comprising:means for receiving ink input; means for performing container detectionfor each container within the ink input; means for performing connectordetection for each connector within the ink input; means for performingshape recognition for each container and each connector detected withinthe ink input; and means for performing chart recognition for containersand connectors recognized within the ink input.